class Person {
    constructor(state,age) {
        console.log('constructor___start');
        this.state = state;
        this.age = age;

        console.log('constructor___over');
    }
    
    get name() {
        console.log('进行取值操作~');
        return this.state;
    }
    
    // 问题：这么用set？？？？？？
    set name(childName) {
        console.log('进行设置值中~');
        
        // this.name = name; 使用 this.name 将会循环调用
        // Reflect.set(this,'name',name);
        this.state.push(childName);
    }
    
    sayHi() {   
        console.log(`hi,i am ${this.name},now is ${this.age} years old`);
    }
    
}

let p1 = new Person(['daixa'],18);
console.log(p1);

p1.name = 'ddd';

console.log(p1);
let descriptor = Reflect.getOwnPropertyDescriptor(p1,'state');

console.log(descriptor);